
// let mode = process.env.NODE_ENV;
// let devMode = mode === 'development';

const {hostname, port, protocol} = window.location;
if (protocol === 'file:') {
  console.error("请将项目放置到服务器中运行，或者本地开启一个服务运行项目！！！")
}

const AppConfig = {
  env: 'mock',  // mock -> mock环境， dev -> 开发环境
  backend: {
    mock: {
      host: hostname,
      port: port,
      prefix: "/static/mock",
    },
    dev: {
      host: "localhost",
      port: "3000",
      prefix: "/api/v1",
    },
    prod: {
      host: "xxx.xxx.xxx.xxx", // todo
      port: "8000",
      prefix: "/api/v1",
    },
    test: {
      host: "localhost",
      port: "8080",
      prefix: "/api/v1",
    }
  }
}

export default AppConfig;
